package com.kool.kadmin.system.dao;

import com.kool.kadmin.system.bean.SysUserDo;
import com.kool.kadmin.system.vo.UserConditionVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author luyu
 */
public interface SysUserDao {
    int insert(SysUserDo sysUserDo);

    int batchInsert(List<SysUserDo> list);

    SysUserDo getById(@Param("id") long id);

    int updatePwd(SysUserDo sysUserDo);

    int updateState(SysUserDo sysUserDo);

    SysUserDo getByLoginName(@Param("loginName") String loginName);

    void addErrorTimes(@Param("loginName") String loginName, @Param("state") Integer state, @Param("cmt") String cmt);

    void updateLogin(SysUserDo userDo);

    Integer getTotal(@Param("condition") UserConditionVo condition);

    List<SysUserDo> getUsersPage(@Param("condition") UserConditionVo condition, @Param("offset") int offset, @Param("rows") int rows);

    void updateInfo(SysUserDo userDo);

    /**
     * 查询所有用户
     *
     * @return
     */
    List<SysUserDo> getAll();

    /**
     * 根据用户姓名查询用户信息
     *
     * @param userName
     * @return
     */
    SysUserDo getByUserName(@Param("userName") String userName);
}
